Skip to content

fix(changelog): make CHANGELOG_OLD.md rotation more resilient#202

Merged
AlCalzone merged 3 commits into
masterfrom
copilot/fix-footer-link-rotation
May 5, 2026
Merged

fix(changelog): make CHANGELOG_OLD.md rotation more resilient#202
AlCalzone merged 3 commits into
masterfrom
copilot/fix-footer-link-rotation

Conversation

Copilot AI commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

When rotating old changelog entries from README.md into CHANGELOG_OLD.md, the Older entries are in [CHANGELOG_OLD.md](CHANGELOG_OLD.md). footer line was being included in the last rotated entry and moved into CHANGELOG_OLD.md, leaving the README without a footer.

Root cause

parseChangelogFile extends each ### version entry to the next ##/### header. When the footer appears after the last version entry (no subsequent header follows), it's absorbed into that entry's content. On rotation, the entry—footer included—moves to CHANGELOG_OLD.md.

Fix

  • packages/plugin-changelog/src/index.ts — In executeCheckStage, after parsing README entries and only when CHANGELOG_OLD.md is present, detect the footer pattern at the end of the last parsed entry. If found, strip it from the entry and prepend it to parsed.after, so it flows into changelog_after (written back to README only, never to CHANGELOG_OLD.md).

  • packages/plugin-changelog/src/index.test.ts — Two new tests: one verifying the footer is moved to changelog_after during the check stage, one verifying post-rotation file contents (footer in README, absent from CHANGELOG_OLD.md).

README.md ## Changelog
  ### 2.0.0 ...        ← stays in README
  ### 1.0.0 ...        ← rotated to CHANGELOG_OLD (no footer)
  Older entries are in [CHANGELOG_OLD.md]...  ← stays in README ✓

Copilot AI changed the title [WIP] Fix footer link rotation issue in iobroker plugin fix(changelog): preserve "Older entries" footer in README during CHANGELOG_OLD.md rotation Apr 30, 2026
Copilot AI requested a review from AlCalzone April 30, 2026 08:18
@AlCalzone AlCalzone changed the title fix(changelog): preserve "Older entries" footer in README during CHANGELOG_OLD.md rotation fix(changelog): make CHANGELOG_OLD.md rotation more resilient May 5, 2026
@AlCalzone AlCalzone marked this pull request as ready for review May 5, 2026 07:44
@AlCalzone AlCalzone merged commit 2684817 into master May 5, 2026
14 checks passed
@AlCalzone AlCalzone deleted the copilot/fix-footer-link-rotation branch May 5, 2026 07:47
AlCalzone added a commit that referenced this pull request May 6, 2026
* Local changes are now snapshotted and restored if the release fails locally (#205)
* Fix: make `CHANGELOG_OLD.md` rotation more resilient (#202)
AlCalzone added a commit that referenced this pull request May 6, 2026
* Local changes are now snapshotted and restored if the release fails locally (#205)
* Fix: make `CHANGELOG_OLD.md` rotation more resilient (#202)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iobroker plugin: "Older entries" footer-link rotates into CHANGELOG_OLD.md instead of staying in README

2 participants